package com.my.wechat.builder;

import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutNewsMessage;

public class NewsBuilder {
	public WxMpXmlOutNewsMessage build(String description, String picUrl,
			String title,String url,
			WxMpXmlMessage wxMessage) {
		WxMpXmlOutNewsMessage.Item item = new WxMpXmlOutNewsMessage.Item();
		item.setDescription(description);
		item.setPicUrl(picUrl);
		item.setTitle(title);
		item.setUrl(url);
		
		WxMpXmlOutNewsMessage  m = WxMpXmlOutMessage.NEWS()
				  .fromUser(wxMessage.getToUser())
				  .toUser(wxMessage.getFromUser())
				  .addArticle(item)
				  .build();
		return m;
	}
	
}
